#include <bits/stdc++.h>
using namespace std;
 
char *__abc147, *__xyz258, __ma369[1000000];
#define __hv007() ((__abc147==__xyz258) && (__xyz258=(__abc147=__ma369)+fread(__ma369,1,100000,stdin),__abc147==__xyz258) ? EOF : *__abc147++)

int getInt(){
	int sgn = 1;
	char ch = __hv007();
	while( ch != '-' && ( ch < '0' || ch > '9' ) ) ch = __hv007();
	if ( '-' == ch ) {sgn = 0;ch=__hv007();}
 
	int ret = (int)(ch-'0');
	while( '0' <= (ch=__hv007()) && ch <= '9' ) ret = ret * 10 + (int)(ch-'0');
	return sgn ? ret : -ret;
}
 
#ifndef ONLINE_JUDGE
int const SIZE = 23;
#else
int const SIZE = 2E5+10;
#endif

using vi = vector<int>;
using vvi = vector<vi>;

vvi A;

bool isOK(){
    return A[0][0] < A[0][1] 
        && A[1][0] < A[1][1]
        && A[0][0] < A[1][0]
        && A[0][1] < A[1][1];
}

bool proc(){
    for(int i=0;i<4;++i){
        if(isOK()) return true;

        swap(A[0][0], A[0][1]);
        swap(A[1][0], A[1][1]);
        swap(A[0][0], A[1][1]);
    }
    return false;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("1.txt", "r", stdin);
#endif
    int nofkase = getInt();
    while(nofkase--){
        A.assign(2, vi(2, 0));
        for(auto & v : A)for(auto & i : v) i = getInt();
        puts(proc()?"YES":"NO");
    }
    return 0;
}
